<?php

!defined('IN_FENGTOP') && exit('Access Denied');

class listmodel {

	var $db;
	var $base;

	function listmodel(&$base) {
		$this->base = $base;
		$this->db = $base->db;
	}

	function get_list_num($totalSub, $sub){
		$totalNum = 0;
		
		for($i = 0; $i < $totalSub; $i++){
			$numArr = $this->db->result_first("SELECT COUNT(*) AS num FROM `".DB_TABLEPRE."post`
			             where `fid`   = {$sub[$i]['fid']} 
			               and status  = '0'
			               and first   = '1'");
			$totalNum += $numArr['num'];
		}
		return $totalNum;
	}
	
}